package springannotaion.compment22;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.beans.factory.config.ConstructorArgumentValues;
import org.springframework.beans.factory.support.AbstractBeanDefinition;
import org.springframework.beans.factory.support.RootBeanDefinition;
import org.springframework.stereotype.Component;

/**
 * @author: wyy-sss
 * @date: 2020-02-09 11:09
 **/
@Component
public class BeanFactoryProcessor2 implements BeanFactoryPostProcessor {

	@Override
	public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
		RootBeanDefinition definition = (RootBeanDefinition) beanFactory.getBeanDefinition("a2");
		//definition.setAutowireMode(AbstractBeanDefinition.AUTOWIRE_BY_TYPE);
		//definition.setBeanClass();
		ConstructorArgumentValues argumentValues = new ConstructorArgumentValues();
		//argumentValues.addIndexedArgumentValue();
		//definition.setConstructorArgumentValues();
		System.out.println("BeanFactoryProcessor2******postProcessBeanFactory------------start");
	}
}
